package eu.irreality.dai.world.gen;

import java.awt.Color;
import java.util.Random;

import eu.irreality.dai.gameplay.world.LevelDescriptor;
import eu.irreality.dai.ui.cell.DisplayableCharacter;
import eu.irreality.dai.ui.cell.DisplayableObject;
import eu.irreality.dai.world.level.Level;

/**
 * Root class for the level generators.
 * 
 */
public abstract class LevelGenerator
{

    public static final DisplayableObject WALL = new DisplayableCharacter('#',
	    Color.LIGHT_GRAY);

    public static final DisplayableObject GROUND = new DisplayableCharacter(
	    '.', Color.BLUE);

    public static final DisplayableObject CLOSED_DOOR = new DisplayableCharacter(
	    '+', Color.ORANGE);

    public static final DisplayableObject OPEN_DOOR = new DisplayableCharacter(
	    '/', Color.ORANGE);

    public static final DisplayableObject UNDEF = new DisplayableCharacter('#',
	    Color.WHITE);

    /*
     * Better as entities. public static final DisplayableObject UP_STAIRS = new
     * DisplayableCharacter( '<', Color.LIGHT_GRAY);
     * 
     * public static final DisplayableObject DOWN_STAIRS = new
     * DisplayableCharacter( '>', Color.LIGHT_GRAY);
     */

    /**
     * Pseudo-random number generator.
     */
    protected static Random rand = new Random();

    /**
     * Default constructor.
     */
    public LevelGenerator()
    {

    }

    /**
     * Generates a Level of size cols x rows.
     * 
     * @param rows
     *            Height of the Level.
     * @param cols
     *            Width of the Level.
     * @return The newly Level created.
     */
    // public abstract Level generate(int rows, int cols);
    /**
     * Generates a Level for a given LevelDescriptor.
     * 
     * @return The newly created Level.
     */
    public abstract Level generate(LevelDescriptor ld);

}
